<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img src="tim.jpeg" id="scream"/>
<canvas id="mycanvas" width="200" height="200" style="border: 1px solid #ccc"></canvas>

<script>
        var c=document.getElementById("mycanvas");
        var ctx=c.getContext("2d");
        img=document.getElementById("scream");
        img.onload=function(){
            ctx.drawImage(img,0,0);
        };


</script>
</body>
</html>